package cn.htsyb.synergy.maker;

import cn.htsyb.synergy.maker.config.Maker;
import cn.htsyb.synergy.maker.engine.IDBMetaEngine;
import cn.htsyb.synergy.maker.engine.ITmplEngine;
import cn.htsyb.synergy.maker.engine.impl.MysqlMetaEngine;
import cn.htsyb.synergy.maker.engine.impl.VelocityEngine;
import cn.htsyb.synergy.maker.model.MetaTable;

import java.util.List;

/**
 * 自动代码生成启动类
 *
 * @author lakeside
 * @email hubin_yuan.410@hotmail.com
 * @date 2019-03-26
 */
public class MakerApplication {
    public static void main(String[] args) {
        try {
            Maker maker = Maker.getInstance();
            IDBMetaEngine dbMetaEngine = new MysqlMetaEngine(maker);
            List<MetaTable> metaTableList = dbMetaEngine.generate();
            ITmplEngine tmplEngine = new VelocityEngine(maker);
            tmplEngine.generate(metaTableList);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
